Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter prefix in keys #51

Closed
wants to merge 4 commits into from
Closed

Conversation

buschjost
Copy link
Contributor

I added the possibility to (optionally) prefix-filter for keys. I know that this once was already part of Gaufrette and was removed. However, as long as the proposed filter interface not available I would really like to have this included again.

The current method of retrieving all keys is just not suitable if you have to deal with a few 10K objects in an S3 or other cloud bucket.

My change is compatible with the current keys() method as it just adds an optional parameter. All adapters for which I did not implement the prefix filtering will throw an appropriate exception if you try to filter with a prefix.

…mplemenmted in AmazonS3 storage adapter) but could also be done locally if there is no other way.

The new parameter is optional and most storage adapter currently do not have implemented. They throw an Exception if you try to use it.

Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>
Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>
Signed-off-by: Oliver Buschjost <github@oliver-buschjost.de>
@Herzult
Copy link
Contributor

Herzult commented Apr 15, 2012

I'm not convinced by the utility of this because Gaufrette is more a read/write system than anything else.
The file keys should be stored in a database.

@buschjost
Copy link
Contributor Author

My usecase of Gaufrette involves other external systems modifying content on the cloud storage. (This works as a watch-folder: they add content and when I can find it it is processed).
For this the listing of directory/keys is necessary as I do not exactly know what keys will be there. This results in the prefix-filtering beeing relevant for me.

@l3l0 l3l0 closed this Sep 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants